package com.ziiwee.reduce.describe.models;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ziiwee.reduce.describe.ControllerDescribe;
import com.ziiwee.reduce.describe.HandlerDescribe;
import org.springframework.core.ResolvableType;

import java.util.List;

/**
 * @author ziiwee
 * @data 2020/8/12
 */
public class ControllerDescribeModel implements ControllerDescribe {

    private String name;
    @JsonSerialize(using = ResolvableTypeSerializer.class)
    private ResolvableType type;
    private String label;
    private String description;

    @JsonSerialize(using = ResolvableTypeSerializer.class)
    private ResolvableType subjectType;
    private List<HandlerDescribe> handlers;
    private String id;

    public ControllerDescribeModel(String name, ResolvableType type, String label, String description, ResolvableType subjectType, List<HandlerDescribe> handlers, String id) {
        this.name = name;
        this.type = type;
        this.label = label;
        this.description = description;
        this.subjectType = subjectType;
        this.handlers = handlers;
        this.id = id;
    }

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public ResolvableType getType() {
        return type;
    }

    public void setType(ResolvableType type) {
        this.type = type;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public ResolvableType getSubjectType() {
        return subjectType;
    }

    public void setSubjectType(ResolvableType subjectType) {
        this.subjectType = subjectType;
    }

    @Override
    public List<HandlerDescribe> getHandlers() {
        return handlers;
    }

    public void setHandlers(List<HandlerDescribe> handlers) {
        this.handlers = handlers;
    }
}
